﻿using System;
using System.Collections.Generic;
using System.Text;
using ByteUtilHelpV2;

namespace ByteUtilHelpV2Test
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("ByteUtilHelpV2 Test");
                byte[] _testByteArray = new byte[10] { 0, 1, 2, 4, 8, 16, 32, 64, 128, 255 };
                Console.WriteLine(string.Format("ByteArrayToHexType.BitConverter ==>{0}", ByteToolV2.ToHexString(_testByteArray, ByteArrayToHexType.BitConverter)));//000102040810204080FF
                Console.WriteLine(string.Format("ByteArrayToHexType.ConvertAll ==>{0}", ByteToolV2.ToHexString(_testByteArray, ByteArrayToHexType.ConvertAll)));//000102040810204080FF
                Console.WriteLine(string.Format("ByteArrayToHexType.Loop ==>{0}", ByteToolV2.ToHexString(_testByteArray, ByteArrayToHexType.Loop)));//000102040810204080FF
                string _hexString = "000102040810204080FF";
                Console.WriteLine("ConvertHexString==>");
                foreach (byte b in ByteToolV2.ConvertHexString(_hexString))
                    Console.WriteLine(b);
                Console.WriteLine("ConvertHexString<==");
                Console.WriteLine(string.Format("ToHexStringWithBlank ==>{0}", ByteToolV2.ToHexStringWithBlank(_testByteArray)));//000102040810204080FF
                byte[] _testByte = new byte[2] { 128, 255 };
                int a = Convert.ToInt32("0d", 16);
                Console.WriteLine(a);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.Trim());
            }
            finally
            {
                Console.ReadLine();
            }

        }
    }
}
